/*
This file is part of Jumpers.

Jumpers is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Jumpers is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Jumpers.  If not, see <http://www.gnu.org/licenses/>.
*/

package org.chaoticengine.cgll.entity.component;

/**
 * The Command class is used to represent any command (input) that
 * can be issued to an Entity with this component.
 */
public abstract class Command {
    protected boolean enabled = false;
    protected IActiveComponent owner = null;

    public Command(IActiveComponent owner) {
        this.owner = owner;
    }

    public IActiveComponent getOwner() {
        return(this.owner);
    }

    public void enable() {
        enabled = true;
        this.owner.enableCommand(this);
    }

    public void disable() {
        enabled = false;
        this.owner.disableCommand(this);
    }

    public boolean isEnabled() {
        return (enabled);
    }

    public abstract void doAction(int delta);
}
